#pragma once

#include "Widgets/Dock/DockWidgetTitleBarBase.h"
#include "Widgets/RectangleWidget.h"
#include "Widgets/TextWidget.h"
#include "Widgets/ImageWidget.h"
#include "Widgets/Mouse/MouseWidget.h"
#include "DockWidgetTitleBar.m.h"


//title bar of docked widget
RCLASS()
class WHENGINE_API RDockWidgetTitleBar : public RDockWidgetTitleBarBase
{
    ROBJECT

public:
    RDockWidgetTitleBar();

    virtual void SetDockWidget(TSharedObjectPtr<RWidget> InDockWidget) override
    {
        //do nothing
    }
    virtual void SetTitle(const CString & InTitle) override;
    virtual CString GetTitle() const override;

    virtual void Highlight() override;
    virtual void Unhighlight() override;
    virtual bool IsHighlighted() const override;

    virtual TDelegate<void,RDockWidgetTitleBarBasePtr>& OnCloseButtonClicked() override;
protected:
    RRectangleWidgetWeakPtr Background;
    RRectangleWidgetWeakPtr HighlightBar; 
    RTextWidgetWeakPtr Text;

    RImageWidgetWeakPtr CloseButton;
    RMouseWidgetWeakPtr CloseButtonMouse;

    TDelegate<void,RDockWidgetTitleBarBasePtr> OnCloseButtonClickedEvent;


};